#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll rd(){char c = getchar();ll f = 1,x = 0;
	while(!isdigit(c)){if(c == '-')f = -1;c = getchar();}
	while(isdigit(c))x = x * 10 + c - '0',c = getchar();
	return x * f;}
ll n;priority_queue<ll,vector<ll>,greater<ll> > q,e;
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	n = rd();for(ll i = n;i;i--)q.push(rd());
	for(ll i = 1;i <= n;i++){
		if(e.size() && q.top() > e.top())e.pop();
		e.push(q.top()),q.pop();
	}cout << e.size();return 0;
}
